// 数据保护
import request from "@/request/request"

export default {
  //  存储平台
  //  获取列表
  getStoreListApi() {
    return request("get", "/dataproject/s3_backup_platfrom/")
  },

  // 创建快照备份平台
  appendStoreApi(data) {
    return request("put", "/dataproject/s3_backup_platfrom/", data)
  },

  // 编辑快照备份平台
  modifyStoreApi(data) {
    return request("post", "/dataproject/s3_backup_platfrom/update", data)
  },

  // 删除
  deleteStoreApi(data) {
    return request("DELETE", "/dataproject/s3_backup_platfrom/", data)
  },

  // 有效性测试
  validStoreApi(data) {
    return request("post", "/dataproject/s3_backup_platfrom/valid", data)
  },


  //快照复制平台-查询
  getCopyListApi() {
    return request("get", "/dataproject/snap_cppy_platform/")
  },

  //快照复制平台-添加
  appendCopyApi(data) {
    return request("post", "/dataproject/snap_cppy_platform/", data)
  },

  //快照复制平台-修改
  modifyCopyApi(id, data) {
    return request("put", `/dataproject/snap_cppy_platform/${id}/`, data)
  },

  //快照复制平台-删除
  deleteCopyApi(id) {
    return request("DELETE", `/dataproject/snap_cppy_platform/${id}/`)
  },

  //快照复制平台-查询远端集群的网关
  getRemotegatewayApi(data) {
    return request("put", "/dataproject/snap_cppy_platform/getRemotegateway/", data)
  },

//快照复制平台-集群可用性检查
  getRemoteClusterHealthApi(data){
    return request("put", "/dataproject/snap_cppy_platform/getcheckValidity/", data)
  },

  //快照复制平台-跨集群获取可备份池
  getCopyPoolApi() {
    return request("get", "/dataproject/snap_cppy_platform/getCopyPool/")
  },


  //快照复制平台-配置远端集群
  getRemoteClusterApi() {
    return request("put", `/dataproject/snap_cppy_platform/remote`)
  },


  // 保护网关
  // 获取网关
  getGatewayListApi() {
    return request("get", "/dataproject/project_gateway/")
  },

  // 创建网关
  appendGatewayOptionApi(data) {
    return request(
      "put",
      "/dataproject/project_gateway/",
      data
    )
  },

  // 编辑网关
  modifyGatewayListApi(data) {
    return request(
      "post",
      "/dataproject/project_gateway/update",
      data
    )
  },

  // 删除网关
  deleteGatewayListApi(data) {
    return request(
      "DELETE",
      "/dataproject/project_gateway/",
      data
    )
  },

  // 获取网关选项
  getGatewayOptionApi() {
    return request(
      "post",
      "/dataproject/project_gateway/option"
    )
  },

  // 保护策略
  // 获取策略
  getStrategyListApi(data) {
    return request("get", "/dataproject/project_strategy/", data)
  },

  // 创建策略
  appendStrategyApi(data) {
    return request("put", "/dataproject/project_strategy/", data)
  },

  // 编辑策略
  modifyStrategyApi(data) {
    return request("post", "/dataproject/project_strategy/update", data)
  },

  // 删除策略
  deleteStrategyApi(data) {
    return request("DELETE", "/dataproject/project_strategy/", data)
  },

  // 获取策略选项
  getStrategyOptionApi(data) {
    return request("post", "/dataproject/project_strategy/option", data)
  },

  //保护策略--块存储卷快照复制
  //保护策略-创建
  appendStrategyCopyApi(data) {
    return request("post", "/dataproject/protect_strategy/", data)
  },

  //保护策略-更新
  updateStrategyCopyApi(id,data) {
    return request("put", `/dataproject/protect_strategy/${id}/`, data)
  },

  //保护策略-删除
  deleteStrategyCopyApi(id) {
    return request("DELETE", `/dataproject/protect_strategy/${id}/`)
  },


  // 保护任务
  // 获取列表
  getTaskListApi(data) {
    return request("get", "/dataproject/project_task/", data)
  },

  // 创建策略
  appendTaskApi(data) {
    return request("put", "/dataproject/project_task/", data)
  },

  // 编辑任务
  modifyTaskApi(data) {
    return request("post", "/dataproject/project_task/update", data)
  },

  // 删除任务策略
  deleteTaskApi(data) {
    return request("DELETE", "/dataproject/project_task/", data)
  },

  // 获取任务选项
  getTaskOptionApi(data) {
    return request("post", "/dataproject/project_task/option", data)
  },


  // 获取任务详情列表
  getTaskDetailApi(data) {
    return request("get", "/dataproject/project_task_record/", data)
  },

  // 删除任务详情
  deleteTaskDetailApi(data) {
    return request("DELETE", "/dataproject/project_task_record/", data)
  },


  //卷复制关系-查询
  getBlockStorageListApi() {
    return request("get", "/dataproject/snap_copy_relation/")
  },

  //卷复制关系-切换
  changeBlockStorageApi(data) {
    return request("put", "/dataproject/snap_copy_relation/switchover/", data)
  },


  //卷复制关系-恢复
  recoverBlockStorageApi(data) {
    return request("put", "/dataproject/snap_copy_relation/start/", data)
  },

  //卷复制关系-暂停
  stopBlockStorageApi(data){
    return request("put", "/dataproject/snap_copy_relation/stop/", data)
  },

  //卷复制关系-同步
  syncBlockStorageApi(data){
    return request("put", "/dataproject/snap_copy_relation/imageSync/", data)
  },



  //保护任务 --块储存卷快照复制
  //保护任务--查询
  getTaskCopyApi() {
    return request("get", "/dataproject/snap_copy_protect_task/")
  },

  //保护任务-创建
  appendTaskCopyApi(data) {
    return request("post", "/dataproject/snap_copy_protect_task/", data)
  },


  //保护任务-编辑
  modifyTaskCopyApi(id, data) {
    return request("put", `/dataproject/snap_copy_protect_task/${id}/`, data)
  },

  //保护任务--删除
  deleteTaskCopyApi(id) {
    return request("DELETE", `/dataproject/snap_copy_protect_task/${id}/`)
  },

  //保护任务-查找符合创建mirror的块
  getImageListApi(data){
    return request("put", "/dataproject/snap_copy_protect_task/getImageList/", data)
  }
}
